const common = {
    node: {
        __dirname: true, // 相对于webpack 的entry
    },
    mode: process.env.ENV || 'development',
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                use: 'ts-loader',
                exclude: [
                    /node_modules/,
                ]
            },
            {
                test: /\.css$/,
                use: [
                    'style-loader',
                    'css-loader'
                ]
            },
            {
                test: /\.less$/,
                use: [
                    'style-loader',
                    {
                    loader:'css-loader',
                        options:{
                            importLoaders:2
                        }					
                    },
                    'less-loader'
                ]
            },
    		{
                test: /(iconfont.svg)|\.(woff|woff2|eot|ttf|otf)$/,
                use:[
                    {
                        loader:'file-loader',
                        options:{
                            name:'[name].[ext]',  //[path] 上下文环境路径
                        }
                    }				
                ]
            },
           
        ]
    },
    resolve: {
        extensions: [ '.tsx', '.ts', '.js' ],
        alias: {
            'vue$': 'vue/dist/vue.esm.js'
        }
    }
   
}
module.exports = {
    common
}
